<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>卢斌</title>
    <link rel="stylesheet" type="text/css" href="../easyUI/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../easyUI/themes/icon.css">
    <script type="text/javascript" src="../easyUI/jquery.min.js"></script>
    <script type="text/javascript" src="../easyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../addressIP.js"></script>
</head>
<body>

<div id = 'firstlay' class="easyui-layout" style="width:100%;" data-options="fit:true">
    <div data-options="region:'north'" style="height:34px">
        <div id="hed" style="float: left; margin-top: 1px;"></div>
        <div style="float: right; margin-top: 1px;"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="tuichu()">退出登录</a></div>
        <script type="application/javascript">
            function tuichu() {
                localStorage.clear();
                location.href = "index.html";
            }
        </script>
        <script type="application/javascript">
            $('#upload').dialog('open');
        </script>
    </div>
    <div data-options="region:'west'" title="我的实验室" style="width:120px;">
        <div id="sm" class="easyui-sidemenu" style="width: 100%;"  data-options="data:data, onSelect:select"></div>
        <script type="text/javascript">
            var data = [{
                text: '导航菜单',
                state: 'open',
                children: [{
                    text: '使用记录',
                    urlvalue:'<iframe width="100%" height="100%" marginheight="0px" marginwidth="0px" scrolling="auto" frameborder="0" src="Usage_record.html"></iframe>'
                },{
                    text: '申请记录',
                    urlvalue:'<iframe width="100%" height="100%" marginheight="0px" marginwidth="0px" scrolling="auto" frameborder="0" src="application_record.html"></iframe>'
                },{
                    text: '我的实验室',
                    urlvalue:'<iframe width="100%" height="100%" marginheight="0px" marginwidth="0px" scrolling="auto" frameborder="0" src="lab_manage_teacher.html"></iframe>'
                }]
            }];
            function select(item){
                if ($("#tabs").tabs('exists', item.text)) {
                    $('#tabs').tabs('select', item.text);
                } else {
                    $('#tabs').tabs('add',{
                        title:item.text,
                        content:item.urlvalue,
                        closable:true
                    });
                }
            }

            function toggle(){
                var opts = $('#sm').sidemenu('options');
                $('#sm').sidemenu(opts.collapsed ? 'expand' : 'collapse');
                opts = $('#sm').sidemenu('options');
                $('#sm').sidemenu('resize', {
                    width: opts.collapsed ? 60 : 200
                })
            }
        </script>
    </div>
    <div data-options="region:'center',title:'实验室管理系统',iconCls:'icon-ok'">
        <div id="tabs" class="easyui-tabs" data-options="fit:true">

        </div>
    </div>
    <script>
        $(function() {
            $.ajax({
                type: 'post',
                dataType: 'json',
                url: addressip+"/getInformation",
                data:{
                    account : localStorage.getItem("superAccount"),
                    password: localStorage.getItem("password")
                },
                success: function (node) {
                    if(node){
                        var infm = node.name;
                        var ident = "老师";
                        document.getElementById('hed').innerHTML = "<b>欢迎使用，" + infm +" "+ident+"</b>";
                    }
                }
            });
        });
    </script>
</div>
</body>
</html>